//
//  TopCell.m
//  结构
//
//  Created by 看着太阳吃烧饼 on 15/7/21.
//  Copyright (c) 2015年 看着太阳吃烧饼. All rights reserved.
//

#import "TopCell.h"
#import "UIImageView+WebCache.h"
@implementation TopCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setModal:(TopModal *)modal {
    _modal = modal;
    _topStar.average = modal.average;
    [self setNeedsLayout];
}

- (void)layoutSubviews {
    _topTitle.text = _modal.title;
    _topAverage.text = [NSString stringWithFormat:@"%.1f",_modal.average];
    NSString *imageStr = [_modal.images objectForKey:@"medium"];
    [_TopImage sd_setImageWithURL:[NSURL URLWithString:imageStr]];
     
}
@end
